package com.example.mobile2021606128wje0428;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

//生活周期
public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    static String TAG = "LifeCycle";

    @Override
    protected void onCreate(Bundle savedInstanceState) {//回调方法,当满足某条件，自动调用
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);//绑定界面文件
        initView();
        Log.i(TAG, "onCreate: ");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG, "onStart: ");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG, "onResume: ");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG, "onPause: ");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG, "onStop: ");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy: ");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG, "onRestart: ");
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tvMainTitle);
    }
}